package com.fr.dialog;

import java.awt.Window;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class BasicPane extends JPanel
{
  protected BasicDialog dlg;
  private String title = "FineSoft";
  private int width = 800;
  private int height = 600;

  public BasicDialog showWindow(Window paramWindow)
  {
    return showWindow(paramWindow, getDialogTitle(), getDialogWidth(), getDialogHeight());
  }

  public BasicDialog showWindow(Window paramWindow, String paramString, int paramInt1, int paramInt2)
  {
    return showWindow(paramWindow, paramString, paramInt1, paramInt2, null);
  }

  public BasicDialog showWindow(Window paramWindow, String paramString, int paramInt1, int paramInt2, DialogActionListener paramDialogActionListener)
  {
    if (this.dlg == null)
    {
      this.dlg = BasicDialog.showWindow(paramWindow, this, paramString, paramInt1, paramInt2);
      if (paramDialogActionListener != null)
      {
        this.dlg.clearDialogActionListeners();
        this.dlg.addDialogActionListener(paramDialogActionListener);
      }
    }
    return this.dlg;
  }

  public Window getWindowAncestor()
  {
    return SwingUtilities.getWindowAncestor(this);
  }

  public BasicDialog showWindow(Window paramWindow, String paramString, int paramInt1, int paramInt2, boolean paramBoolean)
  {
    if (this.dlg == null)
      this.dlg = BasicDialog.showWindow(paramWindow, this, paramString, paramInt1, paramInt2, paramBoolean);
    return this.dlg;
  }

  public void setDialogTitle(String paramString)
  {
    this.title = paramString;
  }

  public String getDialogTitle()
  {
    return this.title;
  }

  public void setDialogSize(int paramInt1, int paramInt2)
  {
    if (this.dlg != null)
      this.dlg.setSize(paramInt1, paramInt2);
    this.width = paramInt1;
    this.height = paramInt2;
  }

  public int getDialogWidth()
  {
    return this.width;
  }

  public int getDialogHeight()
  {
    return this.height;
  }

  public void checkValid()
    throws Exception
  {
  }
}